package com.yuanfengerp.basicInfoManage.storeinfo.conorller;

import com.yuanfengerp.basicInfoManage.storeinfo.model.Storeinfo;
import com.yuanfengerp.basicInfoManage.storeinfo.service.impl.StoreinfoServiceImpl;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin
public class StoreinfoCon {
    @Autowired
    StoreinfoServiceImpl ssi;

    @PostMapping("/selectStoreAll")
    public Result<List<Storeinfo>> selectStoreAll(@RequestBody Map<String ,Object> params){
        return ssi.selectStoreAll(params);
    }

    @PostMapping("/selectStore")
    public Result<Storeinfo> selectStore(String id){
        return ssi.selectStore(id);
    }

    @PostMapping("/addStore")
    public Result<String> addStore(@RequestBody Storeinfo storeinfo){
        return ssi.addStore(storeinfo);
    }

    @PostMapping("/updateStore")
    public Result<String> updateStore(@RequestBody Storeinfo storeinfo){
        return ssi.updateStore(storeinfo);
    }
}
